package com.zhixi.pattern.notimportant.adapterpattern;

import com.zhixi.pattern.notimportant.adapterpattern.operation.IVoltage220V;
import com.zhixi.pattern.notimportant.adapterpattern.operation.Phone;
import com.zhixi.pattern.notimportant.adapterpattern.operation.Voltage220V;
import com.zhixi.pattern.notimportant.adapterpattern.operation.VoltageAdapter;

/**
 * 适配器模式
 *
 *  作用：把两个不相干的类进行关联起来
 *
 * @作者 ShuHaoNan
 * @邮箱 shuhaonan1@gmail.com
 * @时间 2020/11/17 16:28
 */
public class AdapterPattern {

    public static void main(String[] args) {
        IVoltage220V voltage220V = new Voltage220V();
        Phone phone = new Phone(voltage220V);
        phone.charging(new VoltageAdapter(voltage220V));
    }

}
